import 'babel-polyfill'
import Vue from 'vue'
import CmPC from 'cm-pc'
import 'cm-pc/src/components/style/theme/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
import http from './api/index.js'
import URL from './api/url.js'
import './icons'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VCharts from 'v-charts'
import 'babel-polyfill'
import loading from './utils/loading.js'

import { HappyScroll } from 'vue-happy-scroll'
//自定义组件名
Vue.component('happy-scroll', HappyScroll)
// 引入css
import 'vue-happy-scroll/docs/happy-scroll.css'
// 引入cookie操作
import { setCookie, getCookie, delCookie } from './assets/js/utils.js'

// 模拟数据，运行命令：npm run dev:mock
process.env.NODE_ENV === 'mock' && require('../public/mock')
Vue.use(CmPC)
Vue.use(ElementUI)
Vue.use(VCharts)
Vue.use(loading)

Vue.prototype.$http = http
Vue.prototype.$URL = URL
Vue.prototype.$cookieStore = {
  setCookie,
  getCookie,
  delCookie
}

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')
